import React, {PureComponent} from 'react';
import {
	StyleSheet,
	View,
	Button
} from 'react-native';
import Loading from "./Loading";

/**
 * @FileName: LoadingDemo
 * @Author: mazaiting
 * @Date: 2018/6/25
 * @Description:
 */
class LoadingDemo extends PureComponent {
	render() {
		return (
			<View style={styles.container}>
				<Button
					title='显示'
					onPress={() => this.loading.show()}
				/>
				<Button
					title="关闭"
					onPress={() => this.loading.dismiss()}
				/>
				<Loading ref={(tag) => {this.loading=tag}}/>
			</View>
		)
	}
}

/**
 * 样式属性
 */
const styles = StyleSheet.create({
	container: {
		flex: 1,
		backgroundColor: '#DDD'
	}
});

/**
 * 导出当前Module
 */
module.exports = LoadingDemo;